# loop1.S - print string "0123456789" in the terminal
.section .data
bytevar:
	.rept 10
	.byte 0
	.endr
	.byte 13, 10
.section .text
.globl _start
_start:
	movl $10, %ecx       # ecx is the counter of the loop
	movb $0x30, %al      # 0x30 is the ASCII code of '0'
	movl $bytevar, %ebx  # ebx restores the address of the buffer
L1:
	movb %al, (%ebx)
	incl %ebx
	incb %al
	loop L1
	movl $4, %eax
	movl $1, %ebx
	movl $bytevar, %ecx
	movl $12, %edx
	int $0x80
	movl $1, %eax
	movl $0, %ebx
	int $0x80
